<template>
    <component-a ref="comA"></component-a>
    <div>{{comA.title}}</div>
  </template>
  <script>
   import componentA from "../components/comA.vue"
    export default {
    components: {
        componentA,
    },
    data(){
        return {
            comA:{}
        }
    },
    mounted () {
        this.comA = this.$refs.comA;    //this.$refs保存组件的属性和方法
        console.log(this.comA.title);  // Vue.js
        this.comA.sayHello();  // 弹窗
      }
    }
  </script>